import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_sensor_backend/router/router.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'iOT互联数据',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        useMaterial3: true,
        appBarTheme: const AppBarTheme(
          backgroundColor: Color(0xfff3f3f3),
          surfaceTintColor: Colors.transparent,
          scrolledUnderElevation: 0,
        ),
        colorScheme: ColorScheme.fromSwatch(
          primarySwatch: Colors.grey,
        ).copyWith(
          background: const Color(0xfff3f3f3),
        ),
      ),
      initialRoute: "/",
      onGenerateRoute: (settings) {
        return CupertinoPageRoute(
          builder: (context) {
            return routers[settings.name]!();
          },
        );
      },
    );
  }
}
